//
//  ZGSSearchCell.m
//  Tour
//
//  Created by dllo on 15/10/30.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ZGSSearchCell.h"
#define HEIGHT self.contentView.frame.size.height
#define WIDTH self.contentView.frame.size.width

@implementation ZGSSearchCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    return self;
}

- (void)creatView{
    self.viewImage = [[UIImageView alloc] init];
    [self.contentView addSubview:self.viewImage];
    [_viewImage release];
    self.labelName = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelName];
    [_labelName release];
    self.labelEnglish = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelEnglish];
    [_labelEnglish release];
    self.labelAddress = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelAddress];
    [_labelAddress release];
    self.labelLeixing = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelLeixing];
    [_labelLeixing release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.viewImage.frame = CGRectMake(0, 10, WIDTH / 4.5, HEIGHT - 20);
//    self.viewImage.layer.borderWidth = 1;
    self.labelName.frame = CGRectMake(WIDTH / 4.5 + 5, 10, WIDTH - WIDTH / 4.5 - 5, self.viewImage.frame.size.height / 3);
//    self.labelName.layer.borderWidth = 1;
    self.labelEnglish.frame = CGRectMake(WIDTH / 4.5 + 5, 20 + self.viewImage.frame.size.height / 3, WIDTH - WIDTH / 4.5 - 5, self.viewImage.frame.size.height / 3);
//    self.labelEnglish.layer.borderWidth = 1;
    self.labelAddress.frame = CGRectMake(WIDTH / 4.5 + 5,30 + self.viewImage.frame.size.height / 3 * 2, 100, 20);
    self.labelAddress.font = [UIFont systemFontOfSize:10];
//    self.labelAddress.layer.borderWidth = 1;
    self.labelLeixing.frame = CGRectMake(WIDTH - 100, 20 + self.viewImage.frame.size.height / 3 * 2, 100, HEIGHT - (20 + self.viewImage.frame.size.height / 3 * 2));
//    self.labelLeixing.layer.borderWidth = 1;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
